========================================
"QLISSAJOUS" FIGURES for the Sinclair QL
Written by Jim Waterman, 20 May 2021
========================================

This was written in the space of one evening. I would say it was based on Stephen F. Keevil's "Lissajous Figures" from the July 1983 issue of Sinclair Programs, but in reality there was only one line of that program that was adapted - the line that calculates the PLOT positions of each point that draws the figure. On the QL, everything is drawn using LINE TO rather than merely POINT, and the position and scale of the points had to be experimentally shifted around to fill the active window (#1), which appears perfectly square on screen (try changing the PAPER colour of channel #2 to see it).

A Python script to find the highest common factor of the X and Y frequencies, so that the ratio between them is displayed in its lowest terms, was adapted for the custon function hcf(x,y). Fortunately, the QL has the MOD function (Python's % operator) built in so there was no need to define that separately the way there would be on the Spectrum!
https://www.programiz.com/python-programming/examples/hcf

It should be possible to capture a series of screenshots at different phase angles, save them to the upper memory locations of a 640K+ QL, and recall them in sequence to provide an animated simulation of the creeping phase angle change that occurs when the X and Y frequencies are not fed into an oscilloscope in an exactly quantised ratio (e.g. 2.001:1). However, this will probably involve machine code, which I have never looked into on the 68008, and I have no idea whether or not there will be an equivalent of the LDIR instruction. On the Spectrum, this was as simple as using the internal RAM disc on the 128K models...
